﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucCart.ascx.cs" Inherits="UserControl_ucCart" %>

<script type="text/javascript">
    function UpdateParentsCart(val) {
        if (window.parent.SetShoppingCart != null)
            window.parent.SetShoppingCart(val);
    }
</script>

<script language="javascript" type="text/javascript">
    function UpdateParentsLogin() {
        tb_remove();
        window.parent.location = window.parent.location;
    }
</script>

<asp:Panel ID="pnlViewCart" runat="Server">
    <asp:UpdatePanel ID="pnlShoppingCart" runat="server">
        <ContentTemplate>
            <table border="0" cellpadding="0" cellspacing="0" style="">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td id="tdShoppingCart" runat="server" class="" style="padding-left: 10px">
                        </td>
                    </tr>
                    <caption>
                        </td> </tr> Your Cart
                      <%--  <asp:Label ID="lblNumber" runat="server" Font-Bold="true" ForeColor="#2088d8" Text="0 product" />--%>
                       
                        <tr>
                            <td colspan="1" rowspan="1" style="padding-top: 10px; padding-left: 0px;">
                                <asp:GridView ID="grdShoppingCart" runat="server" AutoGenerateColumns="False" CellPadding="10"
                                    CssClass="grd" GridLines="None" OnRowDataBound="grdShoppingCart_RowDataBound">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Number">
                                            <ItemTemplate>
                                                <%# Container.DataItemIndex + 1 %>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Email">
                                            <ItemTemplate>
                                                <%# Eval("TblEmail.EmailAddress")%>
                                            </ItemTemplate>
                                            <ItemStyle Font-Bold="true" HorizontalAlign="Center" Width="205px" Wrap="True" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Price">
                                            <ItemTemplate>
                                                <asp:Label ID="lblPrice" runat="server" CssClass="clsPriceCart" Text='<%# Eval("Price") %>'></asp:Label>
                                                <asp:Label ID="lblMatchedPrice" runat="server" CssClass="clsPriceCartMatched" Text="0"></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="90" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Quantity">
                                            <ItemTemplate>
                                                <asp:Label ID="txtQuantity" runat="server" Text='1'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="90px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Total Amount">
                                            <ItemTemplate>
                                                <asp:UpdatePanel ID="updatePnlGrid" runat="server">
                                                    <ContentTemplate>
                                                        <asp:Label ID="lblSubTotal" runat="server" CssClass="clsSubTotalPriceCart"></asp:Label>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Delete" FooterStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="~/images/del.ico" OnClick="imgDelete_Click"
                                                    Style="display: block;" ToolTip="Delete" />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <HeaderStyle CssClass="clsGrdHeader" />
                                    <RowStyle CssClass="clsGrdRow" />
                                    <AlternatingRowStyle CssClass="clsGrdAlternateRow" />
                                    <PagerStyle CssClass="clsPage" />
                                </asp:GridView>
                            </td>
                        </tr>
                    </caption>
                </table>
                <asp:Panel ID="pnlCartFooter" runat="server" Width="100%" Style="margin: 5px auto 0">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td style="text-align: right" id="thanh">
                                <span class="clsTotalPriceCart">
                                    <asp:Label ID="Label1" runat="server" CssClass="clsTotalPriceCart" Text="Total Amount:"></asp:Label></span>
                                <b>
                                    <asp:Label ID="lblTotal" runat="server" CssClass="clsTotalPriceCart" Text="0"></asp:Label></b>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="padding: 10px 0 10px 0; text-align: right;" class="style1">
                                <asp:Button ID="imgBtnCheckOut" runat="server" Style="color: white; border-radius: 8px 0 8px 0;
                                    padding: 6px; background: none repeat scroll 0px 0px #00B0E4;" ToolTip="Check out"
                                    Text="Checkout" OnClick="imgBtnCheckOut_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td style="padding: 10px 0 10px 0; text-align: right;">
                                <asp:Label ID="lblCheckOutInfo" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>
